#ifndef BIT_WIN_COLUMNS_H
#define BIT_WIN_COLUMNS_H


#include "bit_range.h"
#include "row_column_bases.h"


namespace BitWin
{


//---- Column concreete classes


// Column displaying bits in the corresponding range
class BitsColumn: public Column
{
    // The range of bits in the column
    const BitRange _range;

public:

    BitsColumn(const QString& title_, const BitRange& range_);

    virtual QVariant data(
        role_t role, const Row& row, const PGenericBitwise& data_
    ) const;
};


// Column displaying information in textual form.
// Substitutes Qt::DisplayRole role given in the request to some other
// value and redirect the request to the Row instance.
class DisplayColumn: public Column
{
    // Role to send to the Row instance in the request
    const role_t _role;

public:

    DisplayColumn(const QString& title_, const role_t role_);

    virtual QVariant data(
        role_t role, const Row& row, const PGenericBitwise& data_
    ) const;
};


} // BitWin namespace end


#endif
